<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="库存库位汇总表" active="activeFlag[0]">
            <div class="row wrapper-y-sm">
                <div class="search-bar p-t-sm col-xs-6">
                    <label class="control-label pull-left">报表类型：</label>
                    <div class="border-none form-radio pull-left">
                        <input type="radio" class="m-r-md pull-left" yb-radio ng-model="condition.priceType" value="1"
                               yb-radio-name="平均价">
                        <input type="radio" class="m-r-md pull-left" yb-radio ng-model="condition.priceType" value="2"
                               yb-radio-name="标准价">
                    </div>
                </div>
                <div class="search-bar wrapper-none col-xs-6">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search(1)" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <div class="btn btn-default base-color">
                            <div title="导出" yb-download download-url="exportParam.url" download-param="condition">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('showAgentAdSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="仓库"
                               ng-model="condition.warehouseCode">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAgentAdSearch" search-data="search(1)" reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label"><span>仓库</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.warehouseCode">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"><span>库区</span>：</label>
                            <input type="text" class="form-control" ng-model="condition.areaCode">
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label">时间：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.startTime"
                                   datepicker-popup="{{'yyyy-MM-dd'}}"
                                   ng-click="showStartDate = !showStartDate"
                                   ng-change="checkDate(condition, 'startTime', 'endTime')"
                                   is-open="showStartDate" close-text="关闭" modal-size="small" readonly>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"></label>
                            <label class="control-label wave-line">~</label>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"></label>
                            <input type="text" class="form-control date-picker" ng-model="condition.endTime"
                                   datepicker-popup="{{'yyyy-MM-dd'}}"
                                   ng-click="showEndDate = !showEndDate"
                                   ng-change="checkDate(condition, 'startTime', 'endTime')"
                                   is-open="showEndDate" close-text="关闭" modal-size="small" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x" style="height:82px;">
                        <table class="table-fixed border-none">
                            <thead>
                                <tr>
                                    <th width="60" rowspan="2" class="text-center th-check">序号</th>
                                    <th width="160" rowspan="2" class="text-center th-check">仓库</th>
                                    <th width="160" rowspan="2" class="text-center th-check">库区</th>
                                    <th class="text-center th-check" width="200" colspan="2">期初库存</th>
                                    <th class="text-center th-check" width="200" colspan="2">入库</th>
                                    <th class="text-center th-check" width="200" colspan="2">出库</th>
                                    <th class="text-center th-check" width="200" colspan="2">期末库存</th>
                                </tr>
                                <tr>
                                    <th class="text-center th-check border-top" width="100">数量</th>
                                    <th class="text-center th-check border-top" width="100">成本合计</th>
                                    <th class="text-center th-check border-top" width="100">数量</th>
                                    <th class="text-center th-check border-top" width="100">成本合计</th>
                                    <th class="text-center th-check border-top" width="100">数量</th>
                                    <th class="text-center th-check border-top" width="100">成本合计</th>
                                    <th class="text-center th-check border-top" width="100">数量</th>
                                    <th class="text-center th-check border-top" width="100">成本合计</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" style="top:82px">
                        <table class="table-fixed border-none">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index">
                                <td width="60" class="text-center spill-dots" title="{{$index+1}}">
                                   <span>{{$index+1}}</span>
                                </td>
                                <td width="160" class="text-center spill-dots" title="{{item.warehouseCode}}">
                                   <span>{{item.warehouseCode}}</span>
                                </td>
                                <td width="160" class="text-center spill-dots" title="{{item.areaCode}}">
                                   <span>{{item.areaCode}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.preQuantity}}">
                                    <span>{{item.preQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.preAmount}}">
                                    <span>{{item.preAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.inQuantity}}">
                                    <span>{{item.inQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.inAmount}}">
                                    <span>{{item.inAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.outQuantity}}">
                                    <span>{{item.outQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.outAmount}}">
                                    <span>{{item.outAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.afterQuantity}}">
                                    <span>{{item.afterQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{item.afterAmount}}">
                                    <span>{{item.afterAmount}}</span>
                                </td>
                            </tr>
                            <tr ng-if="sumRowData" class="yellow-bg">
                                <td width="60" class="text-center spill-dots"></td>
                                <td width="320" colspan="2" class="text-center spill-dots">总计</td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.preQuantity}}">
                                    <span>{{sumRowData.preQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.preAmount}}">
                                    <span>{{sumRowData.preAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.inQuantity}}">
                                    <span>{{sumRowData.inQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.inAmount}}">
                                    <span>{{sumRowData.inAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.outQuantity}}">
                                    <span>{{sumRowData.outQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.outAmount}}">
                                    <span>{{sumRowData.outAmount}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.afterQuantity}}">
                                    <span>{{sumRowData.afterQuantity}}</span>
                                </td>
                                <td width="100" class="text-center spill-dots" title="{{sumRowData.afterAmount}}">
                                    <span>{{sumRowData.afterAmount}}</span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" style="top:82px">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
    </div>
</div>
